import React, { useEffect } from 'react'
import "aplayer/dist/APlayer.min.css";
import APlayer from "aplayer";
import { useSelector } from 'react-redux';
export default function Aplayer() {
  const { songInfo } = useSelector((state) => state.songInfoSlice);
    useEffect(() => {
      new APlayer({
        container: document.getElementById("aplayer"),
        lrcType: 1,
        audio: { ...songInfo },
        autoplay:true
      });
    }, [songInfo]);
  return <div id="aplayer"></div>;
}
